<?php
load()->func('tpl');
$op = !empty($_GPC['op']) ? $_GPC['op'] : 'display';

if($op =='display'){
	$pindex = max(1, intval($_GPC['page']));
	$psize = 10;

	$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('tg_notification') . "  ORDER BY id DESC ");
	$pager = pagination($total, $pindex, $psize);
	
	$list = pdo_fetchall("select id,title,summary,FROM_UNIXTIME(stime,'%Y-%m-%d ') as stime from".tablename('tg_notification')." ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize,array());
	
	include wl_template('gzhset/notification-list');
}
if($op =='content'){
	
	$list = pdo_fetchall("select id,title,summary,content,FROM_UNIXTIME(stime,'%Y-%m-%d ') as stime from".tablename('tg_notification')."where id = :id ",array(':id' => $_GPC['id']));
	
	include wl_template('gzhset/notification-content');
}
if($op =='post'){
	
	$lists = pdo_fetch("select id,title,summary,content from".tablename('tg_notification')."where id = :id ",array(':id' => $_GPC['id']));
	
	include wl_template('gzhset/notification');
}
exit();